package com.epsilon.pos.productos.view;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;

public class ProductoComposite extends Composite {

	private Text	txtDescripcion;
	private Text	txtMarca;
	private Table	tblProveedores;
	private Table	tblImpuestos;
	private Text	txtPrecioAlPublico;
	private Text	txtCodigo;
	private Button	chkMarca;
	private Button	btnDesvincularProveedor;
	private Button	btnVincularProveedor;
	private Button	btnQuitarImpuesto;
	private Button	btnAgregarImpuesto;
	private Button	btnAgregar;

	/**
	 * Create the composite.
	 * 
	 * @param parent
	 * @param style
	 */
	public ProductoComposite( Composite parent, int style ) {
		super( parent, style );

		Label lblNewLabel = new Label( this, SWT.NONE );
		lblNewLabel.setBounds( 0, 0, 200, 13 );
		lblNewLabel.setText( "Descripci\u00F3n" );

		txtDescripcion = new Text( this, SWT.BORDER | SWT.WRAP | SWT.V_SCROLL );
		txtDescripcion.setBounds( 0, 19, 450, 57 );

		chkMarca = new Button( this, SWT.CHECK );
		chkMarca.setBounds( 0, 82, 50, 16 );
		chkMarca.setText( "Marca" );

		txtMarca = new Text( this, SWT.BORDER );
		txtMarca.setEnabled( false );
		txtMarca.setBounds( 0, 104, 225, 19 );

		Label lblNewLabel_1 = new Label( this, SWT.NONE );
		lblNewLabel_1.setBounds( 0, 173, 61, 13 );
		lblNewLabel_1.setText( "Proveedores" );

		tblProveedores = new Table( this, SWT.BORDER | SWT.FULL_SELECTION );
		tblProveedores.setBounds( 0, 192, 450, 77 );
		tblProveedores.setHeaderVisible( true );
		tblProveedores.setLinesVisible( true );

		TableColumn tblclmnId = new TableColumn( tblProveedores, SWT.NONE );
		tblclmnId.setWidth( 54 );
		tblclmnId.setText( "ID" );

		TableColumn tblclmnDescripcin = new TableColumn( tblProveedores, SWT.NONE );
		tblclmnDescripcin.setWidth( 392 );
		tblclmnDescripcin.setText( "Descripci\u00F3n" );

		btnVincularProveedor = new Button( this, SWT.NONE );
		btnVincularProveedor.setBounds( 300, 275, 150, 23 );
		btnVincularProveedor.setText( "Vincular a proveedor" );

		btnDesvincularProveedor = new Button( this, SWT.NONE );
		btnDesvincularProveedor.setBounds( 144, 275, 150, 23 );
		btnDesvincularProveedor.setText( "Desvincular de proveedor" );

		Label lblNewLabel_2 = new Label( this, SWT.NONE );
		lblNewLabel_2.setBounds( 0, 304, 200, 13 );
		lblNewLabel_2.setText( "Impuestos" );

		tblImpuestos = new Table( this, SWT.BORDER | SWT.FULL_SELECTION );
		tblImpuestos.setLinesVisible( true );
		tblImpuestos.setHeaderVisible( true );
		tblImpuestos.setBounds( 0, 323, 450, 49 );

		TableColumn tableColumn = new TableColumn( tblImpuestos, SWT.NONE );
		tableColumn.setWidth( 54 );
		tableColumn.setText( "ID" );

		TableColumn tableColumn_1 = new TableColumn( tblImpuestos, SWT.NONE );
		tableColumn_1.setWidth( 392 );
		tableColumn_1.setText( "Descripci\u00F3n" );

		btnQuitarImpuesto = new Button( this, SWT.NONE );
		btnQuitarImpuesto.setText( "Quitar impuesto" );
		btnQuitarImpuesto.setBounds( 144, 378, 150, 23 );

		btnAgregarImpuesto = new Button( this, SWT.NONE );
		btnAgregarImpuesto.addSelectionListener( new SelectionAdapter() {
			@Override
			public void widgetSelected( SelectionEvent arg0 ) {

			}
		} );
		btnAgregarImpuesto.setText( "Agregar impuesto" );
		btnAgregarImpuesto.setBounds( 300, 378, 150, 23 );

		txtPrecioAlPublico = new Text( this, SWT.BORDER );
		txtPrecioAlPublico.setBounds( 231, 104, 219, 19 );

		Label lblPrecioDeVenta = new Label( this, SWT.NONE );
		lblPrecioDeVenta.setBounds( 231, 82, 142, 13 );
		lblPrecioDeVenta.setText( "Precio al publico (por unidad):" );

		Label lblNewLabel_3 = new Label( this, SWT.NONE );
		lblNewLabel_3.setBounds( 0, 129, 37, 13 );
		lblNewLabel_3.setText( "C\u00F3digo:" );

		txtCodigo = new Text( this, SWT.BORDER );
		txtCodigo.setBounds( 0, 148, 225, 19 );

		btnAgregar = new Button( this, SWT.NONE );
		btnAgregar.setBounds( 300, 426, 150, 23 );
		btnAgregar.setText( "Agregar" );

	}

	@Override
	protected void checkSubclass() {
		// Disable the check that prevents subclassing of SWT components
	}

	public Button getBtnAgregarImpuesto() {
		return btnAgregarImpuesto;
	}

	public Button getBtnVincularProveedor() {
		return btnVincularProveedor;
	}

	public Table getTblProveedores() {
		return tblProveedores;
	}

	public Button getBtnDesvincularProveedor() {
		return btnDesvincularProveedor;
	}

	public Button getBtnQuitarImpuesto() {
		return btnQuitarImpuesto;
	}

	public Table getTblImpuestos() {
		return tblImpuestos;
	}

	public Button getChkMarca() {
		return chkMarca;
	}

	public Text getTxtMarca() {
		return txtMarca;
	}

	public Text getTxtPrecioAlPublico() {
		return txtPrecioAlPublico;
	}

	public Button getBtnAgregar() {
		return btnAgregar;
	}

	public Text getTxtDescripcion() {
		return txtDescripcion;
	}

	public Text getTxtCodigo() {
		return txtCodigo;
	}
}
